package A1_贪心算法;

import java.util.Arrays;
import java.util.Comparator;

public class 重写数组排序方法 {
    public static void main(String[] args){
        int[] nums={3,-1,0,2};
//        int[] nums = {-5, 3, -2, 4, 1, -6};
        Integer[] integerNums = Arrays.stream(nums).boxed().toArray(Integer[]::new);
        Arrays.sort(integerNums, Comparator.comparingInt(Math::abs));
        System.out.println(Arrays.toString(integerNums));

    }

}
